package com.gxa.modules.service.lx.impl;

import com.gxa.common.vo.R2;
import com.gxa.modules.mapper.lx.GoodsGroupMapper;
import com.gxa.modules.mapper.lx.GoodsTypeMapper;
import com.gxa.modules.pojo.GoodsType;
import com.gxa.modules.service.lx.GoodsGroupService;
import com.gxa.modules.service.lx.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * Created with IntelliJ IDEA.
 * User: zls
 * Date: 2021/12/28 08:54:19
 * Description:
 * Version: V1.0
 */

@Service
public class GoodsGroupServiceImpl implements GoodsGroupService {

    @Autowired(required = false)
    private GoodsGroupMapper goodsGroupMapper  ;


    @Override
    public R2 queryGoodsGroupList() {

        List<Map> list = goodsGroupMapper.queryGoodsGroupList();

        R2 r2 = new R2();
        r2.setCode(200);
        r2.setMsg("查询成功");
        r2.setData(list);
        return r2;

    }

    @Override
    public R2 delGoodsGroup(Map map) {
        Integer result = goodsGroupMapper.delGoodsGroup(map);

        R2 r2 = new R2();
        r2.setCode(200);
        r2.setMsg("删除成功");
        return r2;
    }

    @Override
    public R2 addGoodsGroup(Map map) {
        Integer result = goodsGroupMapper.addGoodsGroup(map);

        R2 r2 = new R2();
        r2.setCode(200);
        r2.setMsg("添加成功");
        return r2;
    }
}
